QuickOPC User's Guide and Reference
Specifying Event Filters (OPC UA Alarms & Conditions)
Development Models > Imperative Programming Model > Imperative Programming Model for OPC UA Alarms & Conditions > Subscribing to Information (OPC UA Alarms & Conditions) > Specifying Event Filters (OPC UA Alarms & Conditions)

The UAEventFilter object (used for specifying the event filters) is probably the most complicated part of the OPC UA Alarms & Condition features. It has two main parts: Select clauses (contained in the SelectClauses property, of UAAttributeFieldCollection type), and a Where clause (contained in the WhereClause property, of UAContentFilterElement type). The Select clauses contain a collection of the attribute fields to return with each event in a notification. The Where clause contains the criteria limiting the notifications.

In order to make the creation of some event filters appear shorter in the code, a UAEventFilterBuilder class is provided. Instances of this builder can be implicitly converted to the event filter itself (hence you can create just the UAEventFilterBuilder objects, and use them at all places where the UAEventFilter object is expected). The builder contains a Where clause, and is a collection of Select clauses. You can therefore use the C# collection initializer to specify the Select clauses.

In COM (tools like VB6, Delphi etc.), creation of OPC UA Event Filters requires longer code. For related information, see http://kb.opclabs.com/Creating_an_OPC_UA_event_filter_in_COM .

See Also

Knowledge Base